import { ref } from 'vue'
import type { CurrencyCreditData } from '../types'
import { useChartData } from './useChartData'

export function useCurrencyCreditData() {
  const { generateCurrencyCreditData } = useChartData()
  
  const mockConfig = {
    startDate: '2015-06-10',
    endDate: '2018-05-23',
    dataPoints: 100
  }

  const currencyCreditData = ref<CurrencyCreditData>({
    looseMoneyLooseCredit: {
      name: '宽货币宽信用',
      data: generateCurrencyCreditData(mockConfig),
      color: '#3B82F6'
    },
    looseMoneyTightCredit: {
      name: '宽货币紧信用',
      data: generateCurrencyCreditData(mockConfig),
      color: '#F59E0B'
    },
    tightMoneyLooseCredit: {
      name: '紧货币宽信用',
      data: generateCurrencyCreditData(mockConfig),
      color: '#3B82F6'
    },
    tightMoneyTightCredit: {
      name: '紧货币紧信用',
      data: generateCurrencyCreditData(mockConfig),
      color: '#F59E0B'
    },
    credit: {
      name: '信用',
      data: generateCurrencyCreditData(mockConfig),
      color: '#3B82F6'
    },
    currency: {
      name: '货币',
      data: generateCurrencyCreditData(mockConfig),
      color: '#F59E0B'
    }
  })

  return {
    currencyCreditData
  }
}
